package com.chapter6;
//服饰类(Decorator)
public class Finery extends Person{
    Person component;

    public void Decorate(Person component){
        this.component = component;
    }

    public void show() {
        if(component != null){
            component.show();
        }
    }
}

//具体服饰类(ConcreteDecorator)
class TShirts extends Finery{
    public void show(){
        System.out.println("大T恤");
        super.show();
    }
}

class BigTrouser extends Finery{
    public void show(){
        System.out.println("裤子");
        super.show();
    }
}

class Sneaker extends Finery{
    public void show(){
        System.out.println("鞋子");
        super.show();
    }
}